home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / stdlib / RCS / div.man,v < prev    next >
Encoding:
Text File  |  1989-01-06  |  1.6 KB  |  72 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @@;
  7.  
  8.  
  9. 1.1
  10. date     89.01.05.18.00.18;  author ouster;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @@
  17.  
  18.  
  19.  
  20. 1.1
  21. log
  22. @Initial revision
  23. @
  24. text
  25. @' Copyright 1989 Regents of the University of California
  26. ' Permission to use, copy, modify, and distribute this
  27. ' documentation for any purpose and without fee is hereby
  28. ' granted, provided that this notice appears in all copies.
  29. ' The University of California makes no representations about
  30. ' the suitability of this material for any purpose.  It is
  31. ' provided "as is" without express or implied warranty.
  32. ' $Header: /sprite/lib/forms/RCS/proto.man,v 1.1 88/12/29 17:09:50 ouster Exp $ SPRITE (Berkeley)
  33. .so \*(]ltmac.sprite
  34. .HS div cmds
  35. .BS
  36. .SH NAME
  37. div, ldiv \- Return quotient and remainder from division
  38. .SH SYNOPSIS
  39. .nf
  40. \fB#include <stdlib.h>
  41.  
  42. \fBdiv_t
  43. div(\fInumer, denom\fB)\fR
  44.  
  45. \fBldiv_t
  46. ldiv(\fInumer, denom\fB)\fR
  47. .SH ARGUMENTS
  48. .AP int numer in
  49. Numerator for division.
  50. .AP int denom in
  51. Denominator for division.
  52. .BE
  53.  
  54. .SH DESCRIPTION
  55. .PP
  56. The \fBdiv\fR and \fBldiv\fR procedures divide \fInumer\fR by \fIdenom\fR
  57. and return both the quotient and remainder, in the \fBquot\fR and
  58. \fBrem\fR fields of the result structure.  If the division is inexact,
  59. the sign of the resulting quotient is that of the algebraic quotient, and
  60. the magnitude of the resulting quotient is the largest integer less than
  61. the magnitude of the algebraic quotient.
  62. .PP
  63. \fBDiv\fR takes \fBint\fR
  64. arguments and produces \fBint\fR results, while \fBldiv\fR works with
  65. \fBlong int\fR arguments and results.
  66.  
  67. .SH KEYWORDS
  68. divide, quotient, remainder
  69. @
  70.